// organizer-entries.js
Organizer.Entries = (function(){

    var Entry = {
        init: function(title,description,priority){
            this.title = title;
            this.description = description;
            this.priority = priority;

            return this;
        }
    };

    var Task = Entry.extend({
        init: function(title,description,priority,endDate){
            this._super.init.apply(this,arguments);
            this.endDate=endDate;
            this.queryObj = $('<li data-id="1"><p><span class="entry-type">Task</span>: '+this.title+' / <em class="end-date">to '+this.endDate+'</em></p><p class="short-description">'+this.description+'</p></li>');

            return this;
        },
        visualize: function(){
            $('#list-container').append(this.queryObj);

            return this;
        }
    });

    var Event = Entry.extend({
        init: function(title,description,priority,startDate,endDate,location){
            this._super.init.apply(this,arguments);
            this.startDate=startDate;
            this.endDate=endDate;
            this.location=location;
            this.queryObj=$('<li data-id="ev1"><p><span class="entry-type">Event</span>: '+this.title+' / From '+this.startDate+'<em class="end-date"> to '+this.endDate+'</em></p><p class="short-description">'+this.location+'</p></li>');

            return this;
        },
        visualize: function(){
            $('#list-container').append(this.queryObj);

            return this;
        },
    
        
    });

    var Anniversary = Entry.extend({
        init: function(title,description,priority,date){
            this._super.init.apply(this,arguments);
            this.date=date;

            return this;
        }
    });

    var Priority = {
        Low: 1,
        Normal: 2,
        High: 3
    };

    return {
        Task: Task,
        Event: Event,
        Anniversary: Anniversary,
        Priority: Priority
    }
})();